<?php

namespace App\Services\Favorite;

use App\Services\ProjectValidate;

/**
 * 收藏验证
 * Class ValidateFavoriteCategory
 * @package App\Services\Favorite
 */
class ValidateFavoriteCategory extends ProjectValidate
{

    /**
     * 自定义子类初始化
     * @param array $initData
     * @return mixed
     */
    public function initValidate($initData = [])
    {
        // TODO: Implement initValidate() method.
        if (!empty($initData['id'])) {
            $this->rules['id']  = 'required|integer|min:1';
        }
    }


    /**
     * @var array 验证规则集合
     */
    public $rules = [
        'app_id'   => 'integer|min:1',
        'id'    => 'integer|min:1',
        'pid'     => 'integer|min:0',
        'name'    => 'min:2|max:25',
        'order' => 'integer|min:1',
        'status' => 'int:0,1',
        'is_public' => 'in:0,1',
    ];


    /**
     * @var array 当前验证错误信息
     */
    public $messages = [

    ];


}